package com.matrix.java.chap_05;

import java.util.Scanner;

/*
    最大数的出现次数
 */
public class Ex5_41 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter numbers: ");
        int i;
        int max = 0;
        int count = 0;
        do {
            i = input.nextInt();
            if (i > max) {
                max = i;
                count = 1;
            } else if (i == max) {
                count++;
            }
        } while (i != 0);
        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);
        input.close();
    }
}
